<?php

use think\facade\Route;

// 支付回调
Route::group('payback', function () {
    Route::post('alipay$',      '@alipayNotify');
    Route::post('wxpay$',       '@wxpayNotify');
    Route::post('alitrans',     '@alitransNotify');
    Route::post('wxtrans',      '@wxtransNotify');
})->prefix('\app\common\logic\Payment');

/* 三方支付 */
Route::group('pay', function () {
    // 检查三方支付订单状态
    Route::get('orderquery',    '@orderquery');
    Route::get('wxopenid',      '@getWxUserOpenid');

})->prefix('\app\common\service\Payment')
->middleware(['\app\common\middleware\Init', '\app\common\middleware\BindLoginUser']);

/* 三方支付 */
Route::group('pay', function () {
    Route::get('wxappid',      '@getWxAppId');
})->prefix('\app\common\service\Payment')
->middleware(['\app\common\middleware\Init', '\app\common\middleware\WithoutLogin', ]);
